package com.ocom.common.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description: TODO
 * @Author: 朱晖
 * @Date: 2022/11/11
 **/
public enum GzhEnum {


	
	GZH(1,"微信","微信"),//微信官方
	CCB(2,"建行数字人民币H5","建行数字人民币H5"), //建行
	GZH2(3,"随行付微信","微信"), //随行付微信
	CMBYWT(4,"招行一网通","招行一网通"), //payway = 30 招行一网通
	CCBGZH(5,"建行公众号","微信"), // 建行公众号
	GZH3(6,"收钱吧","收钱吧"), //收钱吧
	WALLET(7,"虚拟钱包","虚拟钱包"), //虚拟钱包
	JHJH(8,"建行聚合","聚合支付"), //建行聚合 菜市场主扫
	JHDK(9,"建行数字人民币DK","建行数字人民币DK"), //建行代扣
	SXFXCX(10,"随行付小程序","小程序支付"), //随行付小程序
	CCBPAY(11,"中信银行","中信银行全付通"),
	LANZHOUBANK(12,"兰州银行","兰州银行"),
	YINSHENG(13,"银盛","微信"),
	NHE(14,"农行主扫","农行快E付"),
	YUEBUTIE(15,"余额&补贴","余额&补贴"),
	TOUZHI(16,"余额补贴透支","余额&补贴(可透支)"),
	NongHangJf(17,"农行缴费","农行缴费");

	private final Integer key;
	private final String msg;   //通道
	private final String show;  //展示

	GzhEnum(Integer key, String msg,String show) {
		this.key = key;
		this.msg = msg;
		this.show = show;
	}

	/**
	 * 根据key获取value
	 *
	 * @param key : 键值key
	 * @return String
	 */
	public static String getValueByKey(Integer key) {
		GzhEnum[] enums = GzhEnum.values();
		for (int i = 0; i < enums.length; i++) {
			if (enums[i].getKey().equals(key)) {
				return enums[i].getMsg();
			}
		}
		return "";
	}

	public static String getShowValueByKey(Integer key) {
		GzhEnum[] enums = GzhEnum.values();
		for (int i = 0; i < enums.length; i++) {
			if (enums[i].getKey().equals(key)) {
				return enums[i].getShow();
			}
		}
		return "";
	}

	public Integer getKey() {
		return key;
	}

	public String getMsg() {
		return msg;
	}

	public String getShow() {
		return show;
	}


	// 创建一个静态方法，返回枚举的键值对，基于描述或任何其他属性
	public static Map<Integer, String> getGzhEnumMap() {
		Map<Integer, String> colors = new HashMap<>();
		for (GzhEnum gzhEnum : GzhEnum.values()) {
			colors.put(gzhEnum.key, gzhEnum.msg);
		}
		return colors;
	}
}
